﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using HuynhQuangWebsite.Models;
namespace HuynhQuangWebsite.Controllers
{
    public class Ve_chung_toiController : BaseController
    {
        //
        // GET: /AboutPage/

        huynhquangco_websiteEntities ctx = new huynhquangco_websiteEntities();
        public ActionResult Cty_TNHH_Huynh_Quang()
        {
            var model = new AboutListViewModel();
            AboutU about = ctx.AboutUs.SingleOrDefault();
            model.AboutUs = about;
            //employee
            IList<Employee> employees = ctx.Employees.Where(p => p.EmployeeIsVisible).Take(4).ToList();
            model.EmployeeList = employees;
            //strength
            IList<CompanyStrength> strenghts = ctx.CompanyStrengths.Where(p => p.CompanyStrengthIsVisible).ToList();
            model.CompanyStrengthList = strenghts;
            //videos
            IList<Video> videos = ctx.Videos.Where(p => p.VideoIsVisible).OrderBy(p => p.SortOrder).ToList();
            model.VideoList = videos;
            return View(model);
        }

    }
}
